package com.donfu.system.service.house.impl;

import java.util.List;
import java.util.Map;

import com.donfu.common.utils.DateUtils;
import com.donfu.system.domain.house.HouseOrder;
import com.donfu.system.mapper.house.HouseOrderMapper;
import com.donfu.system.service.house.IHouseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 订单信息Service业务层处理
 *
 * @author donfu
 * @date 2021-12-06
 */
@Service
public class HouseOrderServiceImpl implements IHouseOrderService
{
    @Autowired
    private HouseOrderMapper houseOrderMapper;

    /**
     * 查询订单信息
     *
     * @param id 订单信息主键
     * @return 订单信息
     */
    @Override
    public HouseOrder selectHouseOrderById(Long id)
    {
        return houseOrderMapper.selectHouseOrderById(id);
    }

    /**
     * 查询订单信息列表
     *
     * @param houseOrder 订单信息
     * @return 订单信息
     */
    @Override
    public List<HouseOrder> selectHouseOrderList(HouseOrder houseOrder)
    {
        return houseOrderMapper.selectHouseOrderList(houseOrder);
    }

    /**
     * 新增订单信息
     *
     * @param houseOrder 订单信息
     * @return 结果
     */
    @Override
    public int insertHouseOrder(HouseOrder houseOrder)
    {
        return houseOrderMapper.insertHouseOrder(houseOrder);
    }

    /**
     * 修改订单信息
     *
     * @param houseOrder 订单信息
     * @return 结果
     */
    @Override
    public int updateHouseOrder(HouseOrder houseOrder)
    {
        houseOrder.setUpdateTime(DateUtils.getNowDate());
        return houseOrderMapper.updateHouseOrder(houseOrder);
    }

    /**
     * 批量删除订单信息
     *
     * @param ids 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteHouseOrderByIds(Long[] ids)
    {
        return houseOrderMapper.deleteHouseOrderByIds(ids);
    }

    /**
     * 删除订单信息信息
     *
     * @param id 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteHouseOrderById(Long id)
    {
        return houseOrderMapper.deleteHouseOrderById(id);
    }

    @Override
    public List<Map<String, String>> getOrderInfo(Integer orderStatus) {
        return houseOrderMapper.getOrderInfo(orderStatus);
    }

    @Override
    public Map<String,String> getOrderDetails(Long id) {
        return houseOrderMapper.getOrderDetails(id);
    }

    @Override
    public Map<String, Integer> getUserCount() {
        return houseOrderMapper.getUserCount();
    }

    @Override
    public Map<String, Integer> getOrderCount() {
        return houseOrderMapper.getOrderCount();
    }

    @Override
    public Map<String, Integer> getOrderPriceCount() {
        return houseOrderMapper.getOrderPriceCount();
    }

    @Override
    public Map<String, Integer> getGoodsCount() {
        return houseOrderMapper.getGoodsCount();
    }

    @Override
    public List<Map<String, String>> getGoodsGroupCount() {
        return houseOrderMapper.getGoodsGroupCount();
    }

    @Override
    public List<Map<String, String>> getOrderPriceSum() {
        return houseOrderMapper.getOrderPriceSum();
    }

    @Override
    public List<Map<String, String>> getOrderSum() {
        return houseOrderMapper.getOrderSum();
    }

    @Override
    public List<Map<String, Object>> getMyOrderList(Integer userId, Integer orderStatus) {
        return null;
    }


}
